home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / include / signal.h < prev    next >
C/C++ Source or Header  |  1996-01-30  |  3KB  |  92 lines

  1. /* This is file signal.h */
  2. /* This file may have been modified by DJ Delorie (Jan 1991).  If so,
  3. ** these modifications are Coyright (C) 1991 DJ Delorie, 24 Kirsten Ave,
  4. ** Rochester NH, 03867-2954, USA.
  5. */
  6.  
  7. /* This may look like C code, but it is really -*- C++ -*- */
  8. /* 
  9. Copyright (C) 1989 Free Software Foundation
  10.     written by Doug Lea (dl@rocky.oswego.edu)
  11.  
  12. This file is part of GNU CC.
  13.  
  14. GNU CC is distributed in the hope that it will be useful,
  15. but WITHOUT ANY WARRANTY.  No author or distributor
  16. accepts responsibility to anyone for the consequences of using it
  17. or for whether it serves any particular purpose or works at all,
  18. unless he says so in writing.  Refer to the GNU CC General Public
  19. License for full details.
  20.  
  21. Everyone is granted permission to copy, modify and redistribute
  22. GNU CC, but only under the conditions described in the
  23. GNU CC General Public License.   A copy of this license is
  24. supposed to have been given to you along with GNU CC so you
  25. can know your rights and responsibilities.  It should be in a
  26. file named COPYING.  Among other things, the copyright notice
  27. and this notice must be preserved on all copies.  
  28. */
  29.  
  30. #ifndef _signal_h
  31. #define _signal_h
  32.  
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37.  
  38. /* This #define KERNEL hack gets around bad function prototypes on most */
  39. /* systems. If not, you need to do some real work... */
  40.  
  41. #define KERNEL
  42. #include <sys/signal.h>
  43. #undef KERNEL
  44.  
  45. /* The Interviews folks call this SignalHandler. Might as well conform. */
  46. /* Beware: some systems think that SignalHandler returns int. */
  47. typedef void (*SignalHandler) ();
  48.  
  49. extern SignalHandler signal(int sig, SignalHandler action);
  50. extern SignalHandler sigset(int sig, SignalHandler action);
  51. extern SignalHandler ssignal(int sig, SignalHandler action);
  52. extern int           gsignal (int sig);
  53. extern int           kill (int pid, int sig);
  54.  
  55. #ifndef hpux /* Interviews folks claim that hpux doesn't like these */
  56. struct sigvec;
  57. extern int           sigsetmask(int mask);
  58. extern int           sigblock(int mask);
  59. extern int           sigpause(int mask);
  60. extern int           sigvec(int sig, struct sigvec* v, struct sigvec* prev);
  61. #endif
  62.  
  63. /* The Interviews version also has these ... */
  64.  
  65. #define SignalBad ((SignalHandler)-1)
  66. #define SignalDefault ((SignalHandler)0)
  67. #define SignalIgnore ((SignalHandler)1)
  68.  
  69. /* Posix signal handling */
  70. typedef    int    sigset_t;
  71.  
  72. struct sigaction
  73. {
  74.     void    (*sa_handler)();
  75.     sigset_t    sa_mask;
  76.     int        sa_flags;
  77. };
  78.  
  79. extern int    sigaction(int, struct sigaction *, struct sigaction *);
  80. extern int    sigemptyset(sigset_t *);
  81. extern int    sigfillset(sigset_t *);
  82. extern int    sigaddset(sigset_t *, int);
  83. extern int    sigdelset(sigset_t *, int);
  84. extern int    sigismember(sigset_t *, int);
  85.  
  86. #ifdef __cplusplus
  87. }
  88. #endif
  89.  
  90. #endif
  91.  
  92.